xen/arm: p2m: Simplify p2m type check by using bitmask
authorJulien Grall <julien.grall@arm.com>
Wed, 20 Jul 2016 16:10:50 +0000 (17:10 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 26 Jul 2016 22:36:32 +0000 (15:36 -0700)
commita97bedb2120eb5b277eb5a9cca85f4e659c17cbe
tree52c048edb4ad70d3802aeb314ad09f747a77fb9d
parent8cfe8bcf33cf371f3f1cbf7029d0bc1e2fa12769
xen/arm: p2m: Simplify p2m type check by using bitmask

The resulting assembly code for the macros is much simpler and will
never contain more than one instruction branch.

The idea is taken from x86 (see include/asm-x86/p2m.h). Also move the
two helpers earlier to keep all the p2m type definitions together.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/p2m.h